

import requests
import json

url = "http://httpbin.org/ip"

r = requests.get(url)

ip = json.loads(r.text)["origin"]

print("我的外网IP：", ip)

# ip138.com

